-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Batch query package #2942
base: master
Are you sure you want to change the base?
Conversation
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2013-2020 Ankush Chadda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to have my name in the copyright ? I am not aware if this is the correct thing or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea absolutely okay. you can get boilerplate MIT license text from github or other places 👍
whoah this is really awesome! I'm excited to help get this over the finishline & release it. |
@charmander any thoughts on this? I think it looks p great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments on things we should change. And needs some tests around errors, error handling, and ensuring the client is still usable after an error (you typically need to flush after an error I believe? Could be wrong there...tests will uncover these things though 😄 )
} | ||
catch(err) { | ||
process.nextTick(() => { | ||
throw err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why catch & throw on next tick? Doesn't this create an uncatchable error which will crash a node process?
assert.strictEqual(response.rowCount, 1) | ||
} | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to see some tests for errors / error handling / error recovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added test-error-handling.ts
If it’s going to be a separate package instead of an API change to pg’s default query type – why in this repo? |
@brianc @charmander please have a look at the PR and provide feedback |
I had to make changes in the types/pg to get the build running again |
waouh, so happy to see that ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, it would be great to add explanations about :
- the benefits of batched queries vs non-batched
- the difference with pipelining (which is not implemented yet)
- perhaps also some hints on the underlying mechanism (multiple BIND etc) for future contributors
I also wonder if any advice about the number of parameters is needed ? is there a hard limit ?
I think this important question remains unanswered
in other words : are maintainers of this repo willing to take responsability for this new package ? |
@abenhamdine I have followed what @brianc advised me here. |
Moving it to draft to add typescript definitions |
Is this still alive / any help needed to get this done? I would like to use this myself. |
Hey @hillac , happy to continue the work if maintainers would confirm on what was asked above |
Attempts to fix #2257